/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author owtee
 */
@Entity
@Table(name = "job_status")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "JobStatus.findAll", query = "SELECT j FROM JobStatus j"),
    @NamedQuery(name = "JobStatus.findByStatusId", query = "SELECT j FROM JobStatus j WHERE j.statusId = :statusId"),
    @NamedQuery(name = "JobStatus.findByStatusName", query = "SELECT j FROM JobStatus j WHERE j.statusName = :statusName"),
    @NamedQuery(name = "JobStatus.findByCreateUser", query = "SELECT j FROM JobStatus j WHERE j.createUser = :createUser"),
    @NamedQuery(name = "JobStatus.findByCreateDate", query = "SELECT j FROM JobStatus j WHERE j.createDate = :createDate"),
    @NamedQuery(name = "JobStatus.findByModifyUser", query = "SELECT j FROM JobStatus j WHERE j.modifyUser = :modifyUser"),
    @NamedQuery(name = "JobStatus.findByModifyDate", query = "SELECT j FROM JobStatus j WHERE j.modifyDate = :modifyDate")})
public class JobStatus implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 2)
    @Column(name = "Status_Id")
    private String statusId;
    @Size(max = 50)
    @Column(name = "Status_Name")
    private String statusName;
    @Size(max = 10)
    @Column(name = "Create_User")
    private String createUser;
    @Column(name = "Create_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date createDate;
    @Size(max = 10)
    @Column(name = "Modify_User")
    private String modifyUser;
    @Column(name = "Modify_Date")
    @Temporal(TemporalType.TIMESTAMP)
    private Date modifyDate;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "statusId")
    private Collection<Jobs> jobsCollection;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "statusId")
    private Collection<JobStatusStatement> jobStatusStatementCollection;

    public JobStatus() {
    }

    public JobStatus(String statusId) {
        this.statusId = statusId;
    }

    public String getStatusId() {
        return statusId;
    }

    public void setStatusId(String statusId) {
        this.statusId = statusId;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getCreateUser() {
        return createUser;
    }

    public void setCreateUser(String createUser) {
        this.createUser = createUser;
    }

    public Date getCreateDate() {
        return createDate;
    }

    public void setCreateDate(Date createDate) {
        this.createDate = createDate;
    }

    public String getModifyUser() {
        return modifyUser;
    }

    public void setModifyUser(String modifyUser) {
        this.modifyUser = modifyUser;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }

    @XmlTransient
    public Collection<Jobs> getJobsCollection() {
        return jobsCollection;
    }

    public void setJobsCollection(Collection<Jobs> jobsCollection) {
        this.jobsCollection = jobsCollection;
    }

    @XmlTransient
    public Collection<JobStatusStatement> getJobStatusStatementCollection() {
        return jobStatusStatementCollection;
    }

    public void setJobStatusStatementCollection(Collection<JobStatusStatement> jobStatusStatementCollection) {
        this.jobStatusStatementCollection = jobStatusStatementCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (statusId != null ? statusId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof JobStatus)) {
            return false;
        }
        JobStatus other = (JobStatus) object;
        if ((this.statusId == null && other.statusId != null) || (this.statusId != null && !this.statusId.equals(other.statusId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.JobStatus[ statusId=" + statusId + " ]";
    }
    
}
